home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 25
/
025.d81
/
t.rotate sprites
< prev
next >
Wrap
Text File
|
2022-08-26
|
2KB
|
122 lines
ROTATE SPRITES
by
Dean Rossa
COMMODORE POWER/PLAY MAGAZINE
June/July, 1986
p.60
The title of this program says it
all: with ROTATE SPRITES you can
rotate a sprite 90 degrees or flip it
180 degrees around a horizontal or
vertical axis without having to
redesign the sprite.
When you run ROTATE SPRITES, you
first see a sample sprite. Pressing
"Y" will display the data for that
sprite. (You will be prompted to see
the data after every rotation.) Once
you have seen the data, pressing any
key will take you to a menu that lets
you
1. Flip the sprite right to left
2. Flip sprite up to down
3. Rotate sprite 90 degrees, spreading
data evenly over columns and rows.
4. Rotate sprite 90 degrees, stripping
data from right side of sprite.
There is really no need to talk
about the first two options, but
options Three and Four might need some
explaining. You see, a sprite grid
has 21 rows and 24 columns; it isn't a
perfect square. Thus when you rotate
a sprite 90 degrees, the new sprite
will not be identical to the
original.
Option Three deals with this problem
by dropping every eighth column from
the old sprite while Option Four
shaves three of the rightmost columns
off of the old sprite. Thus the
configuration of the original sprite
will determine which option you
choose.
OK, how do you use ROTATE SPRITES
in your own programs? The first
thing that you must do is go to the
data statements at the end of ROTATE
SPRITES and change them to make your
own sprite. When you go back to the
menu screen, you can rotate the new
sprite. After each rotation, you
can see the data for that rotation.
If you write this data down, you can
use it in your own program.
FILES REQUIRED:
ROTATE SPRITES
-----------< end of text >------------